class ButtonRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;
	Point2i TexturePosition;

	ButtonRenderer(ITexture *texture, const Point2i &pos) :
		Texture(texture),
		TexturePosition(pos)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		renderer->Translate(8, 8, 8);

		switch (block.Data & 0x07)
		{
		case 1:
			renderer->Rotate(90, 0, 1, 0);
			break;
		case 2:
			renderer->Rotate(-90, 0, 1, 0);
			break;
		case 3:
			break;
		case 4:
			renderer->Rotate(180, 0, 1, 0);
			break;
		}

		renderer->Translate(-8, -8, -8);

		renderer->Draw(Box(Texture, Point3i(6, 4, (block.Data & 0x08) != 0 ? 1 : 2), Point3i(5, 6, 0)).SetAll(TexturePosition + Point2i(5, 6)));
	}
};